package com.kerio.observer.mouse;

/**
 * Created by hetao on 2018/3/21.
 * 被观察者
 */
public class Mouse {
    MouseEventListener eventListener;

    public Mouse(MouseEventListener eventListener){
        this.eventListener=eventListener;
    }

    public void click(){
        System.out.println("Mouse be clicked");
        eventListener.onClick();
    }

    public void doubleClick(){
        System.out.println("Mouse be double clicked");
        eventListener.onDoubleClick();
    }

    public void up(){
        System.out.println("Mouse be up");
        eventListener.onUp();
    }

    public void down(){
        System.out.println("Mouse be down");
        eventListener.onDown();
    }

}
